import {getListsFetch,getListsAsyncFetch} from "../services/search"
export default {
  namespace:"search",
  state:{
    text:'dvaText',
    lists:[]
  },
  // 同步
  reducers:{
    getLists(state,action){
      return {
        ...state,
        lists:action.payload
      }
    }
  },
  // 异步
  effects:{
    *getListsAsync({payload},{call,put}){
      const res = yield call(getListsAsyncFetch,payload)
      yield put({
        type:'getLists',
        payload:res.lists
      })


    }
  }
}